I need to check the access rights for different attributes in DXL scripting

Hi,

I need to check the access rights of the different attributes simultaneously. Can some one help me out?

Please find the attached script.Currently I am able to do only for one attribute.

Reagrds,
Shriraam
SystemAdmin - Thu Feb 14 02:25:29 EST 2013

Re: I need to check the access rights for different attributes in DXL scripting
llandale - Thu Feb 14 14:34:47 EST 2013

Something like this:

Module modHandle = current 
bool inherited Val inheritedDef
string valueRes, defRes, NameAD
AttrDef attrDef
for attrDef in modHandle do
{  valueRes = isAccessInheritedVal(modHandle,attrDef,inheritedVal)
   NameAD = ad.name
   if (inheritedVal == false)
   {
      valueRes = inheritedVal(modHandle, attrDef)
      if (null valueRes) //
      then print NameAD "\tSUCCESS! AccessVal is now INHERITED!\n"
      else print NameAD "\tFAILURE setting AccessVal:  " valueRes
   }
 
   defRes = isAccessInheritedDef(modHandle,attrDef,inheritedDef) 
   if (inheritedDef == false)
   {
      defRes = inheritedDef(modHandle, attrDef)
      if (null defRes ) //
      then print NameAD "\tSUCCESS! AccessDef is now INHERITED!\n"
      else print NameAD "\tFAILURE setting AccessDef:  " defRes 
   }
}


-Louie

Re: I need to check the access rights for different attributes in DXL scripting
SystemAdmin - Fri Feb 15 06:15:31 EST 2013

llandale - Thu Feb 14 14:34:47 EST 2013

Something like this:

Module modHandle = current 
bool inherited Val inheritedDef
string valueRes, defRes, NameAD
AttrDef attrDef
for attrDef in modHandle do
{  valueRes = isAccessInheritedVal(modHandle,attrDef,inheritedVal)
   NameAD = ad.name
   if (inheritedVal == false)
   {
      valueRes = inheritedVal(modHandle, attrDef)
      if (null valueRes) //
      then print NameAD "\tSUCCESS! AccessVal is now INHERITED!\n"
      else print NameAD "\tFAILURE setting AccessVal:  " valueRes
   }
 
   defRes = isAccessInheritedDef(modHandle,attrDef,inheritedDef) 
   if (inheritedDef == false)
   {
      defRes = inheritedDef(modHandle, attrDef)
      if (null defRes ) //
      then print NameAD "\tSUCCESS! AccessDef is now INHERITED!\n"
      else print NameAD "\tFAILURE setting AccessDef:  " defRes 
   }
}


-Louie

Thanks a ton.Really amazing!! :)

Re: I need to check the access rights for different attributes in DXL scripting
SystemAdmin - Fri Feb 15 06:29:53 EST 2013

llandale - Thu Feb 14 14:34:47 EST 2013

Something like this:

Module modHandle = current 
bool inherited Val inheritedDef
string valueRes, defRes, NameAD
AttrDef attrDef
for attrDef in modHandle do
{  valueRes = isAccessInheritedVal(modHandle,attrDef,inheritedVal)
   NameAD = ad.name
   if (inheritedVal == false)
   {
      valueRes = inheritedVal(modHandle, attrDef)
      if (null valueRes) //
      then print NameAD "\tSUCCESS! AccessVal is now INHERITED!\n"
      else print NameAD "\tFAILURE setting AccessVal:  " valueRes
   }
 
   defRes = isAccessInheritedDef(modHandle,attrDef,inheritedDef) 
   if (inheritedDef == false)
   {
      defRes = inheritedDef(modHandle, attrDef)
      if (null defRes ) //
      then print NameAD "\tSUCCESS! AccessDef is now INHERITED!\n"
      else print NameAD "\tFAILURE setting AccessDef:  " defRes 
   }
}


-Louie

Hello,

I checked it now. I had lot of errors. Moreover I don need to do it for all the Attributes and Type.

I should be able to do only for certain attributes of my choice.

For eg: I should be able to declare it in array(For certain attributes)

Could you please help me out.

Regards,
Shriraam

Re: I need to check the access rights for different attributes in DXL scripting
SystemAdmin - Fri Feb 15 06:53:19 EST 2013

SystemAdmin - Fri Feb 15 06:29:53 EST 2013
Hello,

I checked it now. I had lot of errors. Moreover I don need to do it for all the Attributes and Type.

I should be able to do only for certain attributes of my choice.

For eg: I should be able to declare it in array(For certain attributes)

Could you please help me out.

Regards,
Shriraam

Hello,

I found the error myself. The error is because I am trying to check the access rights even for the non boolean value. Eg:Absolute Number.

Can you please let me know how to do checking only for certain attributes.

Thanks a lot in advance.

Regards,
Shriraam

Re: I need to check the access rights for different attributes in DXL scripting
SystemAdmin - Fri Feb 15 06:58:42 EST 2013

Error

Re: I need to check the access rights for different attributes in DXL scripting
llandale - Fri Feb 15 11:06:57 EST 2013

SystemAdmin - Fri Feb 15 06:53:19 EST 2013
Hello,

I found the error myself. The error is because I am trying to check the access rights even for the non boolean value. Eg:Absolute Number.

Can you please let me know how to do checking only for certain attributes.

Thanks a lot in advance.

Regards,
Shriraam

OK, I am just scribbling not trying to run the code. You'll need to debug it yourself.

Skip skpCheckTheseAttrs = createString() // KEY and DATA both 'string' NameAttr
put(skpCheckTheseAttrs,"MyFirstAttr")
put(skpCheckTheseAttrs,"MySecondAttr")
 
//*****************************************
void  MakeInherited(Module in_mod, string in_NameAttr)
{
   bool  inheritedVal, inheritedDef
   string ErrMess
   AttrDef ad
 
   ad = find(in_mod, in_NameAttr)
   if (null ad)
   {  print "Cannot find attr *" in_NameAttr "*  in module '" name(in_mod) "'\n"
      return()
   }
   ErrMess = isAccessInheritedVal(in_mod,ad,inheritedVal)
   if (inheritedVal == false)
   {
      ErrMess = inheritedVal(in_mod, ad)
      if (null ErrMess) //
      then print in_NameAttr "\tSUCCESS! AccessVal is now INHERITED!\n"
      else print in_NameAttr "\tFAILURE setting AccessVal:  " ErrMess // ErrMess already has trailing '\n'
   }
 
   ErrMess = isAccessInheritedDef(in_mod,ad,inheritedDef) 
   if (inheritedDef == false)
   {
      ErrMess = inheritedDef(in_mod, attrDef)
      if (null ErrMess ) //
      then print in_NameAttr "\tSUCCESS! AccessDef is now INHERITED!\n"
      else print in_NameAttr "\tFAILURE setting AccessDef:  " ErrMess 
   }
}   // end MakeInherited()

 


string NameAttr
for NameAttr in skpCheckTheseAttrs do
{ MakeInherited(modHandle, NameAttr)
}
delete(skpCheckTheseAttrs)
{code}

 

Re: I need to check the access rights for different attributes in DXL scripting
SystemAdmin - Wed Feb 20 07:04:43 EST 2013

llandale - Fri Feb 15 11:06:57 EST 2013

OK, I am just scribbling not trying to run the code. You'll need to debug it yourself.

Skip skpCheckTheseAttrs = createString() // KEY and DATA both 'string' NameAttr
put(skpCheckTheseAttrs,"MyFirstAttr")
put(skpCheckTheseAttrs,"MySecondAttr")
 
//*****************************************
void  MakeInherited(Module in_mod, string in_NameAttr)
{
   bool  inheritedVal, inheritedDef
   string ErrMess
   AttrDef ad
 
   ad = find(in_mod, in_NameAttr)
   if (null ad)
   {  print "Cannot find attr *" in_NameAttr "*  in module '" name(in_mod) "'\n"
      return()
   }
   ErrMess = isAccessInheritedVal(in_mod,ad,inheritedVal)
   if (inheritedVal == false)
   {
      ErrMess = inheritedVal(in_mod, ad)
      if (null ErrMess) //
      then print in_NameAttr "\tSUCCESS! AccessVal is now INHERITED!\n"
      else print in_NameAttr "\tFAILURE setting AccessVal:  " ErrMess // ErrMess already has trailing '\n'
   }
 
   ErrMess = isAccessInheritedDef(in_mod,ad,inheritedDef) 
   if (inheritedDef == false)
   {
      ErrMess = inheritedDef(in_mod, attrDef)
      if (null ErrMess ) //
      then print in_NameAttr "\tSUCCESS! AccessDef is now INHERITED!\n"
      else print in_NameAttr "\tFAILURE setting AccessDef:  " ErrMess 
   }
}   // end MakeInherited()

 


string NameAttr
for NameAttr in skpCheckTheseAttrs do
{ MakeInherited(modHandle, NameAttr)
}
delete(skpCheckTheseAttrs)
{code}

 

Thanks a ton.It worked.